﻿@using QDT.Core.Members
@{
    ViewBag.Title = "用户充值";
    User user = QDTContext.Current.User;
}
@section Head{
    <style>
        #payment_box img{ cursor: pointer; }
    </style>
}

<div class="ui-body">
    <div class="ui-inner">
        <div class="ui-grid-row">

            @Html.Action("UserMenu", new { route = MenuRoute.ChargeCarry })
            
            <div class="ui-grid-20">
                @if (user.IDCardPassed) {
                    <div class="ui-box">
                        <div class="ui-tipbox ui-tipbox-wait">
                            <div class="ui-tipbox-icon">
                                <i class="iconfont" title="帮助">&#xf00b8;</i>
                            </div>
                            <div class="ui-tipbox-content">
                                <h3 class="ui-tipbox-title">充值帮助</h3>
                                <p class="ui-tipbox-explain">1、充值免费，充值产生的第三方支付平台费用由众禧贷承担；</p>
                                <p class="ui-tipbox-explain">2、为了您的资金安全，请您在充值之前先完成实名认证；</p>
                                <p class="ui-tipbox-explain">3、每日的充值限额依据各银行限额为准；</p>
                                <p class="ui-tipbox-explain">4、如果充值金额没有及时到账，请和客服联系。</p>
                            </div>
                        </div>
                        <form name="incharge_form" class="ui-form" id="incharge_form" action="@Url.Action("PostOfflineCharge")" method="post" target="_blank">
                            <fieldset>
                                <legend>充值</legend>

                                <div class="ui-form-item">
                                    <label for="" class="ui-label">充值金额</label>
                                    <input class="ui-input ui-input-large" type="text" id="Money" name="Money" />
                                    <span class="ui-form-other">元</span>
                                    <p class="ui-form-explain">您的资金将从充值银行卡转入合作银行托管账户</p>
                                </div>
                                
                                <div class="ui-form-item">
                                    <label for="" class="ui-label">持卡人姓名</label>
                                    <input class="ui-input ui-input-large" type="text" id="RealName" name="RealName" />
                                </div>
                                
                                <div class="ui-form-item">
                                    <label for="" class="ui-label">充值方式</label>
                                    <div class="ui-form-text">
                                        <ul class="ui-pay" id="payment_box">
                                            <li class=" active">
                                                <label><img src="/Plugins/Content/allinpay.png">
                                                    <i class="iconfont">㐹</i>
                                                </label>
                                            </li>
                                        </ul>
                                    </div>
                                    <p class="ui-form-explain" style="padding:0;color: #e74c3c">重要提示：您在充值成功前切勿关闭支付页面，否则会导致充值无法正常到账。</p>
                                </div>

                                <div class="ui-form-item">
                                    <input type="submit" class="ui-button ui-button-red big"  id="incharge_done" value="充值" />
                                </div>

                            </fieldset>
                            
                            <script type="text/javascript">
                                $(document).ready(function () {
                                    $("#incharge_form").submit(function () {
                                        var inchargeMoney = $("input[name='Money']").val();
                                        if (!(inchargeMoney != '' && !isNaN(inchargeMoney) && inchargeMoney > 0)) {
                                            alert("请输入正确的充值金额");
                                            $("input[name='money']").focus();
                                            return false;
                                        }
                                        return true;
                                    });
                                });
                                
                            </script>
                        </form>
                    </div>
                }
                else
                {
                    <div class="ui-body">
                        <div class="ui-inner">
                            <div class="ui-tipbox ui-tipbox-wait">
                                <div class="ui-tipbox-icon">
                                    <i class="iconfont" title="提示">&#xf0142;</i>
                                </div>
                                <div class="ui-tipbox-content">
                                    <h3 class="ui-tipbox-title">温馨提示</h3>
                                    <p class="ui-tipbox-explain">为了您的账户安全，充值前请进行实名认证</p>
                                    <p class="ui-tipbox-explain"><a href="@Url.Action("BindIdCard")">进行实名认证</a> | <a href="@Url.Action("Index")">返回</a></p>
                                </div>
                            </div>
                        </div>
                    </div>
                }
            </div>

        </div>
    </div>
</div>